<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用js语法创建虚拟DOM</title>
    <!-- 引入React核心库 -->
    <script src="../js/react.development.js"></script>
    <!-- 引入React-DOM -->
    <script src="../js/react-dom.development.js"></script>
</head>
<body>
    <!-- 容器 -->
    <div id="app"></div>
    <script type="text/javascript">
        // 1. 创建一个虚拟DOM
        let VDOM = React.createElement('h1', {id: 'DOM'}, React.createElement('span',null,'Hello React'))
        // 2. 将虚拟DOM渲染到容器中
        ReactDOM.render(VDOM, document.getElementById('app'))
    </script>
</body>
</html>